﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace common.Framework.Encryption
{
	public interface IEncyface
	{
		string EncryMD5(string input);

		/// <summary>
		/// MD5加密
		/// </summary>
		/// <param name="input"></param>
		/// <returns></returns>
		string EncrypyByMD5(string input);
		/// <summary>
		/// SHA1加密
		/// </summary>
		/// <param name="input"></param>
		/// <returns></returns>
		string EncryptBySHA1(string input);
		/// <summary>
		/// 加密字符串
		/// </summary>
		/// <param name="input"></param>
		/// <param name="sKey"></param>
		/// <returns></returns>
		string EncryptString(string input, string sKey);
		/// <summary>
		/// 解密字符串
		/// </summary>
		/// <param name="input"></param>
		/// <param name="sKey"></param>
		/// <returns></returns>
		string DecryptString(string input, string sKey);
		/// <summary>
		/// AES 加密
		/// </summary>
		/// <param name="input"></param>
		/// <param name="key"></param>
		/// <returns></returns>
		string EncryptByAES(string input, string key);
		/// <summary>
		/// AES解密
		/// </summary>
		/// <param name="input"></param>
		/// <param name="key"></param>
		/// <returns></returns>
		string DecryptByAES(string input, string key);
		/// <summary>
		/// RSA加密
		/// </summary>
		/// <param name="plaintext"></param>
		/// <param name="publicKey"></param>
		/// <returns></returns>
		string EncryptByRSA(string plaintext, string publicKey);
		/// <summary>
		/// RSA解密
		/// </summary>
		/// <param name="ciphertext"></param>
		/// <param name="privateKey"></param>
		/// <returns></returns>
		string DecryptByRSA(string ciphertext, string privateKey);
		/// <summary>
		/// DES 加密
		/// </summary>
		/// <param name="input"></param>
		/// <param name="key"></param>
		/// <returns></returns>
		string EncryptByDES(string input, string key);
		/// <summary>
		/// DES 加密
		/// </summary>
		/// <param name="input"></param>
		/// <param name="key"></param>
		/// <returns></returns>
		byte[] EncryptByDES(byte[] inputBytes, byte[] key, byte[] IV);
		/// <summary>
		/// DES 解密
		/// </summary>
		/// <param name="input"></param>
		/// <param name="key"></param>
		/// <returns></returns>
		string DecryptByDES(string input, string key);
		/// <summary>
		/// DES 解密
		/// </summary>
		/// <param name="input"></param>
		/// <param name="key"></param>
		/// <returns></returns>
		byte[] DecryptByDES(byte[] inputBytes, byte[] key, byte[] iv);
	}
}
